package com.example.mapper;

import com.example.dto.WaterDianPageDto;
import com.example.entity.WaterDian;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface WaterDianMapper {
    @Select("select * from waterdian where dno like concat('%',#{dno},'%')")
    Page<WaterDian> getByDno(WaterDianPageDto waterDianPageDto);

    @Insert("insert into waterdian (dno, cost, left_fee, ct_fee) VALUE (#{dno},#{cost},#{leftFee},#{ctFee})")
    void add(WaterDian waterDian);

    @Delete("delete FROM waterdian where dno = #{dno}")
    void deleteByDno(String dno);

    void update(WaterDian waterDian);
}
